export class LocalStorageManager {
  gameStateKey: string;
  storage: any = window.localStorage;
  constructor() {
    this.gameStateKey = "paoGameState";
  }
  getGameState() {
    const stateJSON = this.storage.getItem(this.gameStateKey);
    return stateJSON ? JSON.parse(stateJSON) : null;
  }

  setGameState(gameState: any) {
    this.storage.setItem(this.gameStateKey, JSON.stringify(gameState));
  }

  clearGameState() {
    this.storage.removeItem(this.gameStateKey);
  }
}